It's more concise and has been around long enough to embrace it.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>
}
}
- let defaultsCopy = Object.assign({}, defaults);
- return Object.assign(defaultsCopy, params);
+ return {...defaults, ...params};
}
this._barLevelActiveBorderColor = null;
this._barLevelOverdriveBorderColor = null;
- let defaultParams = {
+ super._init({
style_class: 'barlevel',
accessible_role: Atk.Role.LEVEL_BAR,
- };
- super._init(Object.assign(defaultParams, params));
+ ...params,
+ });
this.connect('notify::allocation', () => {
this._barLevelWidth = this.allocation.get_width();
});
this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._description.clutter_text.line_wrap = true;
- let defaultParams = {
+ super._init({
style_class: 'message-dialog-content',
x_expand: true,
vertical: true,
- };
- super._init(Object.assign(defaultParams, params));
+ ...params,
+ });
this.connect('notify::size', this._updateTitleStyle.bind(this));
this.connect('destroy', this._onDestroy.bind(this));
child: this.list,
});
- let defaultParams = {
+ super._init({
style_class: 'dialog-list',
x_expand: true,
vertical: true,
- };
- super._init(Object.assign(defaultParams, params));
+ ...params,
+ });
this.label_actor = this._title;
this.add_child(this._title);
textLayout.add_child(this._title);
textLayout.add_child(this._description);
- let defaultParams = {style_class: 'dialog-list-item'};
- super._init(Object.assign(defaultParams, params));
+ super._init({
+ style_class: 'dialog-list-item',
+ ...params,
+ });
this.label_actor = this._title;
this.add_child(this._iconActorBin);
this._animationInProgress = true;
// start the animation
- this._dragActor.ease(Object.assign(params, {
+ this._dragActor.ease({
+ ...params,
opacity: this._dragOrigOpacity,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
this._onAnimationComplete(this._dragActor, eventTime);
},
- }));
+ });
}
_finishAnimation() {
}
let pspec = actor.find_property(propName);
- let transition = new Clutter.PropertyTransition(Object.assign({
+ let transition = new Clutter.PropertyTransition({
property_name: propName,
interval: new Clutter.Interval({value_type: pspec.value_type}),
remove_on_complete: true,
repeat_count: repeatCount,
auto_reverse: autoReverse,
- }, params));
+ ...params,
+ });
actor.add_transition(propName, transition);
transition.set_to(target);
'@effects.radial.brightness', VIGNETTE_BRIGHTNESS, easeProps);
this.ease_property(
'@effects.radial.sharpness', VIGNETTE_SHARPNESS,
- Object.assign({onComplete}, easeProps));
+ {onComplete, ...easeProps});
} else {
- this.ease(Object.assign(easeProps, {
+ this.ease({
+ ...easeProps,
opacity: 255 * this._fadeFactor,
onComplete,
- }));
+ });
}
}
this.ease_property(
'@effects.radial.brightness', 1.0, easeProps);
this.ease_property(
- '@effects.radial.sharpness', 0.0, Object.assign({onComplete}, easeProps));
+ '@effects.radial.sharpness', 0.0, {onComplete, ...easeProps});
} else {
- this.ease(Object.assign(easeProps, {opacity: 0, onComplete}));
+ this.ease({...easeProps, opacity: 0, onComplete});
}
}
export const CapsLockWarning = GObject.registerClass(
class CapsLockWarning extends St.Label {
_init(params) {
- let defaultParams = {style_class: 'caps-lock-warning-label'};
- super._init(Object.assign(defaultParams, params));
+ super._init({
+ style_class: 'caps-lock-warning-label',
+ ...params,
+ });
this.text = _('Caps lock is on.');